/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hcbank.jpa.entities.helper;

import com.hcbank.classes.AccountHistory;
import com.hcbank.jpa.entities.AccountHistoryEntity;

/**
 *
 * @author NHAHV
 */
public class AccountHistoryHelper {

    public AccountHistory toAccountHistory(AccountHistoryEntity ahe) {
        AccountHistory ah = new AccountHistory();
        try {
            ah.setId(ahe.getId());
            ah.setDeposit(ahe.getDeposit());

            if (ahe.getAccountId() != null) {
                ah.setAccountId(ahe.getAccountId().getId());

            }
            ah.setStatus(ahe.getStatus());
        } catch (Exception e) {
        } finally {
            return ah;
        }
    }
}
